package com.anycl.spring.soundsystem;

import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.List;

@Component(value = "blue")
@Setter
@Slf4j
public class Blue implements CompactDisc {

    private String title;

    private String artist;

    private List<String> tracks;

/*    public Blue(String title, String artist, List<String> tracks) {
        this.title = title;
        this.artist = artist;
        this.tracks = tracks;
    }

    public Blue(String title, String artist) {
        this.title = title;
        this.artist = artist;
    }*/

    public void play() {
        log.info("Playing " + title + " by " + artist);
        for (String track: tracks)
            log.info("-Track: " + track);
    }

    public void playTrack(int m) {
        if (m < tracks.size()) {
            System.out.println("playTrack: " + m + " value : "  + tracks.get(m));
        }
    }


}
